package com.plian.system.entity.im;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import com.plian.system.vo.im.InvestmentDebtVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

/**
 * @description: 投资项目债务主要信息表
 * @author: gangan
 * @create: 2020-04-23 16:27
 */
@Data
@TableName("im_base_investment_debt")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "BaseInvestmentDebt 对象", description = "投资项目债务主要信息表")
public class BaseInvestmentDebt extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 编码
     */
    @ApiModelProperty(value = "编码")
    private String code;

    /**
     * 填报单位
     */
    @ApiModelProperty(value = "填报单位")
    private String filingUnitId;

    /**
     * 主管部门id
     */
    @ApiModelProperty(value = "主管部门id")
    @JsonSerialize(using = ToStringSerializer.class)
    private String deptId;

    /**
     * 填报月度
     */
    @ApiModelProperty(value = "填报月度")
    private String filingMonth;

    /**
     * 审批人
     */
    @ApiModelProperty(value = "审批人")
    private String approvedUser;

    /**
     * 审批时间
     */
    @ApiModelProperty(value = "审批时间")
    @DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
    @JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
    private Date approvedTime;

    /**
     * 审批意见
     */
    @ApiModelProperty(value = "审批意见")
    private String approvedOpinion;

    /**
     * 流程实例id
     */
    @ApiModelProperty(value = "流程实例id")
    private String formType;

    /**
     * 1单户表 2汇总表
     */
    @ApiModelProperty(value = "单户表 2汇总表")
    private Integer type;

    private String summaryJson;

    @TableField(exist = false)
    private List<InvestmentDebtVO> summaryList;

    @TableField(exist = false)
    private List<InvestmentDebt> investmentDebts;

    @TableField(exist = false)
    private List<Long> childIds;


    /**
     * 数据来源 null为系统填报 对应用户id
     */
    @ApiModelProperty(value = "数据来源 null为系统填报 对应用户id")
    private String dataSource;

    /**
     * 数据来源id
     */
    @ApiModelProperty(value = "数据来源id", required = true)
    private String dataSourceId;

}
